为扩散语言模型启用共享前缀的 KV 缓存
文章背景与核心概要
共享前缀的键值(KV)缓存是大语言模型(LLM)实现高吞吐量服务的基石技术,但将其应用到新兴的扩散语言模型(Diffusion Language Models, DLMs)中会导致模型精度崩溃。由于 DLMs 采用双向注意力机制,更新任意一个 Token 都会改变整个上下文并破坏预计算的 KV,从而使模型准确率骤降至接近零。
为了解决这一难题,作者团队推出了 BiCache(双向前缀缓存),这是首款专门针对 DLMs 共享前缀设计的 KV 缓存技术。BiCache 核心利用了一个关键观察:在浅层网络中,共享前缀的 KV 保持高度稳定且可复用,其深度阈值会根据每个请求中共享 Token 的比例进行动态自适应调整。评估结果表明,与现有方法相比,BiCache 将服务吞吐量提升了 36.3% 至 98.3%,而精度差距微乎其微,仅为 0–1.8%。
摘要 (Abstract)
共享前缀的键值(KV)缓存对于高吞吐量的大语言模型(LLM)服务至关重要,但它在面临新兴的扩散语言模型(DLMs)时面临着严峻的挑战。在 DLMs 中,双向注意力机制意味着更新任何 Token 都会动态改变整个上下文及其对应的 KV。因此,专为 LLM 开发的现有缓存技术(它们假设 KV 一旦计算完成便保持不变)会破坏共享前缀的 KV。我们的实验表明,将这些技术直接应用到 DLMs 会导致模型准确率崩溃至接近零。
为了释放高吞吐量 DLM 服务的潜力,我们提出了双向前缀缓存 bicache,这是首款针对 DLMs 中共享前缀的 KV 缓存技术。bicache 的设计基于我们全面分析得出的关键观察:共享前缀的 KV 在浅层中保持稳定且可复用,而浅层的深度取决于每个请求中共享前缀 Token 的比例。因此,bicache 能够动态确定复用共享前缀 KV 的安全层深度,从而消除冗余计算。评估表明,与现有技术相比,bicache 在没有发生精度崩溃的前提下(精度差异仅为 0-1.8%),将服务吞吐量显著提升了 36.3%-98.3%。
Key-value (KV) caching for shared prefixes is essential for high-throughput large language model (LLM) serving, but it faces critical challenges in emerging diffusion language models (DLMs). In DLMs, bidirectional attention means that updating any token dynamically alters the entire context and its corresponding KVs. Thus, existing caching techniques developed for LLMs, which assume that KVs remain invariant once computed, corrupt the shared prefix KVs. Our experiments show that applying these techniques to DLMs causes model accuracy to collapse to near zero.
To unlock high-throughput DLM serving, we propose bidirectional prefix caching, bicache, the first KV caching technique for shared prefixes in DLMs. bicache is designed based on key observations from our comprehensive analysis: shared prefix KVs remain stable and reusable in shallow layers, while the depth of shallow layers depends on the fraction of shared prefix tokens in each request. Thus, bicache dynamically identifies a safe layer depth for reusing shared prefix KVs and eliminates redundant computation. Evaluations demonstrate that bicache significantly improves serving throughput by 36.3%-98.3% compared to existing techniques without accuracy collapse (only 0-1.8% difference).
论文元数据 (Paper Metadata)
- arXiv ID: arXiv:2606.07571 [cs.LG]
- 作者: Younghun Go, Jaehoon Han, Changyong Shin, Chuck Yoo, Gyeongsik Yang
- 主学科领域: 机器学习 (
cs.LG), 人工智能 (cs.AI) - 会议/状态: 已被 EMNLP 2026 主会接收
- 提交时间: 2026年5月26日(2026年9月1日修订,v3版)
- 代码仓库: GitHub - OSSS-KU/BiCache
- 许可证: 知识共享 署名-非商业性使用-禁止演绎 4.0 国际版

- arXiv ID: arXiv:2606.07571 [cs.LG]
- Authors: Younghun Go, Jaehoon Han, Changyong Shin, Chuck Yoo, Gyeongsik Yang
- Primary Subject: Machine Learning (
cs.LG), Artificial Intelligence (cs.AI)- Conference/Status: Accepted to EMNLP 2026 Main Conference
- Submitted: May 26, 2026 (Last revised September 1, 2026, v3)
- Code Repository: GitHub - OSSS-KU/BiCache
- License: Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International